package lulin.w09.service;

import lulin.w09.dao.SchoolDaoInterface;
import lulin.w09.entity.School;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SchoolService implements SchoolServiceInterface {

    @Autowired
    private SchoolDaoInterface schoolDao;

    @Override
    public Long addSchool(School school) {
        return schoolDao.addSchool(school);
    }

    @Override
    public int deleteSchool(Long id) {
        return schoolDao.deleteSchool(id);
    }

    @Override
    public int updateSchool(School school) {
        return schoolDao.updateSchool(school);
    }

    @Override
    public School getSchool(Long id) {
        return schoolDao.getSchool(id);
    }

    @Override
    public List<School> getAllSchools() {
        return schoolDao.getAllSchools();
    }
}    